<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改权限资源</title>
<link href="${ctx }/css/ztreeStyle.css" rel="stylesheet" type="text/css" />
<link href="${ctx }/js/layui/css/layui.css" rel="stylesheet" type="text/css" />
<link href="${ctx }/css/ztree/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="${ctx }/js/niceValidator/jquery.validator.css" />
<script type="text/javascript" src="${ctx }/js/jquery/jquery-1.8.2.min.js"></script>
<link rel="stylesheet" href="${ctx}/js/uploadfy/uploadify.css" type="text/css"></link>
<script type="text/javascript" src="${ctx}/js/uploadfy/jquery.uploadify-3.1.min.js"></script>
<script type="text/javascript" src="${ctx }/js/layer/layer.js"></script>
<script type="text/javascript" src="${ctx }/js/niceValidator/jquery.validator.js"></script>
<script type="text/javascript" src="${ctx }/js/niceValidator/local/zh_CN.js"></script>
<script type="text/javascript" src="${ctx }/js/common.js"></script>
<script type="text/javascript" src="${ctx }/js/ztree/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="${ctx }/js/ztree/jquery.ztree.excheck-3.5.js"></script>
<script>
	$(document).ready(function(){
		$("#submitBtn").click(function(){
            baseEdit('${ctx }/sysman/authResource/upChange.do');
		});
    });
</script>
<style>
	.buttonClass{margin-top:-25px;}
	.uploadify{left:87px;margin-top: 30px;}
</style>
</head>
<body>
<div class="listNavTitle">
    <p>
        <label>系统管理 ></label>
        <label>权限管理</label>
    </p>
</div>
<div class="formbody">
  <div class="formtitle"><span>编辑权限</span></div>
<form id="submitForm">
<input name="authCode" type="hidden" value="${authResource.authCode}" class="dfinput" />
  <ul class="forminfo">
  	  <li>
      <label>父级权限</label>
      <c:if test="${authResource.authparentCode == '0'}">
      	<input value="顶级权限" readonly="readonly" type="text" class="dfinput" />
      </c:if>
      <c:if test="${authResource.authparentCode != '0'}">
      	<input value="${authResourceParent.authName}" readonly="readonly" type="text" class="dfinput" />
      </c:if>
   	 </li>
	 <li>
      <label>权限名称</label>
      <input name="authName" value="${authResource.authName}" type="text" class="dfinput"  data-rule="权限名称:required;"/>
   	 </li>
      <li>
          <label>权限图标</label>
          <select name="iconPic" onchange="selectIconPic(this);" id="selIconPic">
              <option value="">请选择</option>
              <option value="Icon0">图标1</option>
              <option value="Icon1">图标2</option>
              <option value="Icon2">图标3</option>
              <option value="Icon3">图标4</option>
              <option value="Icon4">图标5</option>
              <option value="Icon5">图标6</option>
              <option value="Icon6">图标7</option>
              <option value="Icon7">图标8</option>


              <option value="m1">菜单图标1</option>
              <option value="m2">菜单图标2</option>
              <option value="m3">菜单图标3</option>
              <option value="m4">菜单图标4</option>
              <option value="m5">菜单图标5</option>
              <option value="m6">菜单图标6</option>
              <option value="m7">菜单图标7</option>
              <option value="m8">菜单图标8</option>
              <option value="m9">菜单图标9</option>
              <option value="m10">菜单图标10</option>
              <option value="m11">菜单图标11</option>
              <option value="m12">菜单图标12</option>
              <option value="m13">菜单图标13</option>
              <option value="m14">菜单图标14</option>
              <option value="m15">菜单图标15</option>
              <option value="m16">菜单图标16</option>
              <option value="m17">菜单图标17</option>
              <option value="m18">菜单图标18</option>
              <option value="m19">菜单图标19</option>
              <option value="m20">菜单图标20</option>
              <option value="m21">菜单图标21</option>
              <option value="m22">菜单图标22</option>
              <option value="m23">菜单图标23</option>
              <option value="m24">菜单图标24</option>
              <option value="m25">菜单图标25</option>
              <option value="m26">菜单图标26</option>
          </select>
          <img src="" id="IconImg" style="background: #64cded;"/>
      </li>
   	 <li>
      <label>shrio标识</label>
      <input name="authShrioCode" value="${authResource.authShrioCode}" type="text" class="dfinput"  data-rule="shrio标识:required;"/>
   	 </li>
 	 <li>
      <label>权限类别 </label>
      <select class="select2" name="authType">
      	<option value="MODULAR" <c:if test="${authResource.authType == 'MODULAR'}">selected="selected"</c:if>>模块</option>
      	<option value="MENU" <c:if test="${authResource.authType == 'MENU'}">selected="selected"</c:if>>菜单</option>
      	<option value="FUNCTIONS" <c:if test="${authResource.authType == 'FUNCTIONS'}">selected="selected"</c:if>>功能</option>
      </select>
   	 </li>
   	 <li>
      <label>权限地址</label>
      <input name="authUrl" value="${authResource.authUrl}" type="text" class="dfinput" />
   	 </li>
<%--    	 <li>
      <label>导航栏目图</label>
      <img src="${ctx }/images/llt.jpg" alt="暂无缩略图" id="lltPicImg" style="width:172px;height:100px;"/>
      <input type="hidden" name="picUrl" id="thumbnailPicUrl"/>
      <input type="file" id="file_upload_1" name="file_upload_1" style="height:100px;"/>
   	 </li> --%>
	 <li>
      <label>排序</label>
      <input name="authNo" value="${authResource.authNo}" type="text" class="dfinput"  data-rule="排序:required;digits;"/>
   	 </li>
    <li>
      <label>&nbsp;</label>
      <button class="layui-btn layui-btn-normal" type="button" class="btn" id="submitBtn">确认保存</button>
    </li>
  </ul>
</form>
</div>
</body>
</html>
<script>
    var iconstr = '${authResource.iconPic}';
    $("#selIconPic").val(iconstr);
    selectIconPic($("#selIconPic"));
    function selectIconPic(obj){
        var iconstr = $(obj).val();
        if(panIsNull(iconstr)){
            return;
        }
        $("#IconImg").attr('src', getRealPath() + '/images/custom/menu/' + iconstr + '_1.png');
    }
</script>

